package controllers;
 
import models.*;
 
public class Security extends Secure.Security {
	
    static boolean authenticate(String username, String password) {
    	return models.User.connect(username, password) != null;
    }
    static void onDisconnected() {
        Application.index();
    }
  

    static void onAuthenticated() {
        Admin.index();
    }
    static boolean check(String profile) {
        if("admin".equals(profile)) {
            return true;
        }
        return false;
    }
    static void signIn(models.User user){
    	
    	if (user.isAdmin){
    		
    		user.connect(user.email, user.password);
    	}
    }
    
}